//
//  Bullet.m
//  BeatPlane
//
//  Created by qianfeng on 15-5-6.
//  Copyright (c) 2015年 韩世民. All rights reserved.
//

#import "Bullet.h"
#import "Plane.h"
#define kBulletSpeed 10
@implementation Bullet
-(instancetype)initWithFrame:(CGRect)frame{
    if ([super initWithFrame:frame]) {
        self.image = [UIImage imageNamed:@"Icon.png"];
    }
    return self;
}
//向上飞
-(void)moveup{
    CGRect  frame = self.frame;
    frame.origin.y-= kBulletSpeed;
    self.frame =frame;
    
}
-(void)resetFrame{
    //获取单例飞机的地址
    Plane *plane = [Plane defaultPlane];
    CGRect frame = self.frame;
    //飞机在哪里 子弹就从哪里发射
    frame.origin.x =plane.frame.origin.x+(plane.frame.size.width/2-self.frame.size.width/2);
    frame.origin.y =plane.frame.origin.y;
    
    self.frame =frame;
}
@end
